package com.mlog.njyjy.ndop.msg.common.domain;

import com.jfinal.plugin.activerecord.Model;
import com.mlog.njyjy.ndop.msg.common.domain.core.Timeable;
import com.mlog.njyjy.ndop.msg.common.support.Constants;
import com.mlog.njyjy.ndop.share.sql.annotation.Column;
import com.mlog.njyjy.ndop.share.sql.annotation.Id;
import com.mlog.njyjy.ndop.share.sql.annotation.Table;
import lombok.Data;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 消息主题
 * </p>
 *
 * @author <a href="mailto:yingxiufeng@mlogcn.com">alex</a>
 * @version v1.0, 2020/7/6
 */
@Data
@Accessors(chain = true)
@Table(prefix = Constants.TBL_MSG_PREFIX, comment = "消息主题")
public class Topic extends Model<Topic> implements Timeable {

    @Id
    private Long id;

    @Column(nullable = false, unique = true, comment = "主题名称")
    private String name;

    @Column(length = 11, comment = "分区数")
    private Integer partitions;


    @Column(length = 11, comment = "副本因子")
    private Integer replicationFactor;

    /**
     * 描述
     */
    @Column(length = 255)
    private String description;

    /**
     * 集群 id
     */
    private Long clusterId;

    /**
     * 创建时间
     */
    @Column(updatable = false)
    private LocalDateTime createAt;

    /**
     * 更新时间
     */
    private LocalDateTime updateAt;
}
